/*
* INSANE - Interactive Structural Analysis Environment
*
* Copyright (C) 2003-2005
* Universidade Federal de Minas Gerais
* Escola de Engenharia
* Departamento de Engenharia de Estruturas
* 
* Author's email :    insane@dees.ufmg.br
* Author's website :  http://www.dees.ufmg.br/insane
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package br.ufmg.dees.insane.analysisModel;

import java.util.ArrayList;

import br.ufmg.dees.insane.util.IMatrix;
import br.ufmg.dees.insane.util.IVector;
import br.ufmg.dees.insane.util.geometricProperties.GeometricProperties;
import br.ufmg.dees.insane.util.pointValues.PointValues;
import br.ufmg.dees.insane.util.pointValues.StringPointValues;

/**
*A class representing a SpaceFrame analysis model of a FrameElement.
*
*@author Fonseca, Flavio & Pitangueira, Roque
*@version 1.1
*@since September 2003, modified October 2006
*/
public class SpaceFrame extends FrameElmAnalysis {
	
	private static final long serialVersionUID = 1L;

	public SpaceFrame() {
	}
	
    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getLabel()
     */
    public String getLabel() {
        return "SpaceFrame";
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getInternalVariablesDirLabels()
     */
    public String[] getInternalVariablesLabels() {
        String[] Dlabels = {"Ea", "GAMAy", "GAMAz", "PSIx", "Ky", "Kz"};
        return Dlabels;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getDualInternalVariablesDirLabels()
     */
    public String[] getDualInternalVariablesLabels() {
        String[] Dlabels = {"Nx", "Vy", "Vz", "Tx", "My", "Mz"};
        return Dlabels;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getNumberOfInternalVariables()
     */
    public int getNumberOfInternalVariables() {
        return 6;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getNumberOfDualInternalVariables()
     */
    public int getNumberOfDualInternalVariables() {
        return 6;
    }
    

	/* (non-Javadoc)
	 * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getDOFLabels(int)
	 */
	public ArrayList getDOFLabels(int n) {
		ArrayList <PointValues> al = new ArrayList<PointValues>();
		PointValues spv = new StringPointValues();
	    spv.addPointValue("Dx");
	    spv.addPointValue("Dy");
	    spv.addPointValue("Dz");
	    spv.addPointValue("Rx");
	    spv.addPointValue("Ry");
	    spv.addPointValue("Rz");
		for(int i=0; i<n; i++) {
			al.add(i,spv);
		}
		return al;
	}
	
	/* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.FrameAnalysisModel#getInternalVariableOperator(br.ufmg.dees.insane.util.IMatrix, br.ufmg.dees.insane.util.IVector, br.ufmg.dees.insane.util.IMatrix)
     */
	public IMatrix getInternalVariableOperator(IMatrix d, IMatrix d2, IMatrix d3, IVector n, IMatrix c) {
		IMatrix b = new IMatrix(6,12);
		
		b.setElement(0,0, d.getElement(0,0));
		b.setElement(0,5, d.getElement(3,0));
		
		b.setElement(1,1, d3.getElement(1,0));
		b.setElement(1,5, d3.getElement(2,0));
		b.setElement(1,7, d3.getElement(4,0));
		b.setElement(1,11, d3.getElement(5,0));
		
		b.setElement(2,2, -d3.getElement(1,0));
		b.setElement(2,4, d3.getElement(2,0));
		b.setElement(2,8, -d3.getElement(4,0));
		b.setElement(2,10, d3.getElement(5,0));
		
		b.setElement(3,3, d.getElement(0,0));
		b.setElement(3,9, d.getElement(3,0));
		
		b.setElement(4,2, -d2.getElement(1,0));
		b.setElement(4,4, d2.getElement(2,0));
		b.setElement(4,8, -d2.getElement(4,0));
		b.setElement(4,10, d2.getElement(5,0));
		
		b.setElement(5,1, d2.getElement(1,0));
		b.setElement(5,5, d2.getElement(2,0));
		b.setElement(5,7, d2.getElement(4,0));
		b.setElement(5,11, d2.getElement(5,0));
		
		return b;
	}
	
	/* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getInternalVariableOperator(br.ufmg.dees.insane.util.IMatrix, br.ufmg.dees.insane.util.IVector, br.ufmg.dees.insane.util.IMatrix)
     */
    public IMatrix getInternalVariableOperator(IMatrix d, IMatrix d2, IVector n, IMatrix c) {
    	//This method should not be used
		//because it is needed the third order shape functions derivates
		//to form the B matrix for a PlaneFrame element
    	return null;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getInternalVariableOperator(br.ufmg.dees.insane.util.IMatrix, br.ufmg.dees.insane.util.IVector, br.ufmg.dees.insane.util.IMatrix, br.ufmg.dees.insane.util.IMatrix)
     */
    public IMatrix getInternalVariableOperator(IMatrix d, IMatrix d2, IVector n, IMatrix c, IMatrix u) {
    	//This method should not be used
		//because it is needed the third order shape functions derivates
		//to form the B matrix for a PlaneFrame element
    	return null;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getDualInternalVariableOperator(br.ufmg.dees.insane.util.IMatrix)
     */
    public IMatrix getDualInternalVariableOperator(IMatrix e) {
    	//Matrix e must be FrameElement.getPropertiesMatrix()
		IMatrix d = new IMatrix(6,6);
		double ea = e.getElement(1, 0)*e.getElement(7, 0);
		double eiy = e.getElement(1, 0)*e.getElement(5, 0);
		double eiz = e.getElement(1, 0)*e.getElement(6, 0);
		double ga = e.getElement(2, 0)*e.getElement(7, 0);
		double gj = e.getElement(2, 0)*e.getElement(4, 0);
		d.setElement(0, 0, ea);
		d.setElement(1, 1, eiz*eiz*e.getElement(9, 0)/ga);
		d.setElement(2, 2, eiy*eiy*e.getElement(10, 0)/ga);
		d.setElement(3, 3, gj);
		d.setElement(4, 4, eiy);
		d.setElement(5, 5, eiz);
		return d;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#modifyDualInternalVariableOperator(br.ufmg.dees.insane.util.IMatrix, java.util.ArrayList)
     */
	public IMatrix modifyDualInternalVariableOperator(IMatrix e, GeometricProperties gps)	{
		return e;
	}

    
    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getStateVariableOperator(br.ufmg.dees.insane.util.IVector)
     */
    public IMatrix getStateVariableOperator(IMatrix n2, IVector n1, IMatrix c) {
    	if (n2 == null) {
			n2 = new IMatrix(6,1);
		}
		IMatrix n = new IMatrix(6, 12);
		n.setZero();
		n.setElement(0, 0, n1.getElement(0));
		n.setElement(1, 1, n1.getElement(1));
		n.setElement(2, 2, n1.getElement(1));
		n.setElement(1, 5, n1.getElement(2));
		n.setElement(2, 4, n1.getElement(2));
		n.setElement(3, 3, n1.getElement(0));
		n.setElement(4, 2, n2.getElement(1, 0));
		n.setElement(5, 1, n2.getElement(1, 0));
		n.setElement(4, 4, n2.getElement(2, 0));
		n.setElement(5, 5, n2.getElement(2, 0));
		n.setElement(0, 6, n1.getElement(3));
		n.setElement(1, 7, n1.getElement(4));
		n.setElement(2, 8, n1.getElement(4));
		n.setElement(2, 10, n1.getElement(5));
		n.setElement(1, 11, n1.getElement(5));
		n.setElement(3, 9, n1.getElement(3));
		n.setElement(4, 8, n2.getElement(4, 0));
		n.setElement(5, 7, n2.getElement(4, 0));
		n.setElement(4, 10, -n2.getElement(5, 0));
		n.setElement(5, 11, n2.getElement(5, 0));
		return (n);
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getGeometricOperator(br.ufmg.dees.insane.util.IVector)
     */
    public IMatrix getGeometricOperator(IVector n1) {
        IMatrix G = new IMatrix(3,n1.getSize());
        G.setZero();
        for(int i=0; i<(n1.getSize()/3.0); i++){
        G.setElement(0,3*i,n1.getElement(i*3));
        G.setElement(1,3*i+1,n1.getElement(i*3));
        G.setElement(2,3*i+2,n1.getElement(i*3));
        }
        return G;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getInternalVariablesVector(br.ufmg.dees.insane.util.IVector, br.ufmg.dees.insane.util.IMatrix)
     */
    public IVector getInternalVariablesVector(IVector a, IMatrix b) {
        return a;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getDualInternalVariablesVector(br.ufmg.dees.insane.util.IVector, br.ufmg.dees.insane.util.IMatrix)
     */
    public IVector getDualInternalVariablesVector(IVector a, IMatrix b) {
        return a;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getInternalVariablesTensor(br.ufmg.dees.insane.util.IVector, br.ufmg.dees.insane.util.IMatrix)
     */
    public IMatrix getInternalVariablesTensor(IVector a, IMatrix b) {
        IMatrix chiTensor = new IMatrix(3,3);
        chiTensor.setZero();
        chiTensor.setElement(0,0,a.getElement(3));
        chiTensor.setElement(0,1,a.getElement(0));
        chiTensor.setElement(1,0,a.getElement(0));
        chiTensor.setElement(1,1,a.getElement(4));
        chiTensor.setElement(2,2,a.getElement(5));
        return chiTensor; 
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getDualInternalVariablesTensor(br.ufmg.dees.insane.util.IVector, br.ufmg.dees.insane.util.IMatrix)
     */
    public IMatrix getDualInternalVariablesTensor(IVector a, IMatrix b) {
        return expandTensor(a); 
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#expandVector(br.ufmg.dees.insane.util.IVector)
     */
    public IVector expandVector(IVector a) {
        IVector Vector = new IVector(6);
        Vector.zero();
        Vector.setElement(0,a.getElement(0));
        Vector.setElement(1,0);
        Vector.setElement(2,0);
        Vector.setElement(3,a.getElement(1));
        Vector.setElement(4,a.getElement(2));
        Vector.setElement(5,a.getElement(3));
        return Vector; 
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#expandTensor(br.ufmg.dees.insane.util.IVector)
     */
    public IMatrix expandTensor(IVector a) {
        IMatrix Tensor = new IMatrix(3,3);
        Tensor.setZero();
        Tensor.setElement(0,0,a.getElement(1));
        Tensor.setElement(0,1,a.getElement(0));
        Tensor.setElement(0,2,0);
        Tensor.setElement(1,0,a.getElement(0));
        Tensor.setElement(1,1,a.getElement(2));
        Tensor.setElement(1,2,0);
        Tensor.setElement(2,0,0);
        Tensor.setElement(2,1,0);
        Tensor.setElement(2,2,a.getElement(3));
        return Tensor; 
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#reduceVector(br.ufmg.dees.insane.util.IVector)
     */
    public IVector reduceVector(IVector a) {
        IVector Vector = new IVector(4);
        Vector.zero();
        Vector.setElement(0,a.getElement(0));
        Vector.setElement(1,a.getElement(3));
        Vector.setElement(2,a.getElement(4));
        Vector.setElement(3,a.getElement(5));
        return Vector; 
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#reduceTensor(br.ufmg.dees.insane.util.IMatrix)
     */
    public IVector reduceTensor(IMatrix a) {
        IVector Vector = new IVector(4);
        Vector.zero();
        Vector.setElement(0,a.getElement(0,1));
        Vector.setElement(1,a.getElement(0,0));
        Vector.setElement(2,a.getElement(1,1));
        Vector.setElement(3,a.getElement(2,2));
        return Vector;
    }


    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getDominion()
     */
    public int getDominion() {
        return 3;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getIntegrationFactor(br.ufmg.dees.insane.util.IVector, br.ufmg.dees.insane.util.IMatrix, java.util.ArrayList)
     */
    public double getIntegrationFactor(IVector n, IMatrix cN, ArrayList gps) {
        return 1.0;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getJacobianTransformation(br.ufmg.dees.insane.util.IMatrix, br.ufmg.dees.insane.util.IMatrix)
     */
    public double getJacobianTransformation(IMatrix dl, IMatrix cN) {
        IMatrix aux = new IMatrix(1,3);
        IMatrix dl2 = new IMatrix(1,cN.getNumRow());
        for (int i = 0; i < cN.getNumRow(); i++) {
            dl2.setElement(0,i,dl.getElement(0,3*i));
        }
        aux.mul(dl2,cN);
        return Math.sqrt(Math.pow(aux.getElement(0,0),2.0)+Math.pow(aux.getElement(0,1),2.0)+Math.pow(aux.getElement(0,2),2.0));
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getTransformationMatrix(br.ufmg.dees.insane.util.IMatrix, br.ufmg.dees.insane.util.IMatrix)
     */
    public IMatrix getTransformationMatrix(IMatrix dl, IMatrix cN) {
        IMatrix transf = new IMatrix((dl.getNumCol()/3)*6,(dl.getNumCol()/3)*6);
        transf.setZero();
        IMatrix dl2 = new IMatrix(1,cN.getNumRow());
        for (int i = 0; i < cN.getNumRow(); i++) {
        	dl2.setElement(0,i,dl.getElement(0,3*i));
		}
        IMatrix r = new IMatrix(1,3);
        r.mul(dl2,cN);
        double moduloR = Math.sqrt(Math.pow(r.getElement(0,0),2.0)+Math.pow(r.getElement(0,1),2.0)+Math.pow(r.getElement(0,2),2.0)); 
        double n = (r.getElement(0,2) / moduloR);
        IMatrix aux = new IMatrix(3,3);
        aux.setZero();
        
        //Setting the value of the matrix for an element whose local x axis is not parallel to the global z axis
        if (n!=1 && n!=-1) {
            
            //Setting the value of the variable l, m, n and d
            double l = (r.getElement(0,0)/ moduloR);
            double m = (r.getElement(0,1) / moduloR);
            double d = Math.sqrt(Math.pow(l, 2) + Math.pow(m, 2));
            
            //Setting the value of the aux matrix
            aux.setElement(0, 0, l);
            aux.setElement(0, 1, m);
            aux.setElement(0, 2, n);
            aux.setElement(1, 0, -m/d);
            aux.setElement(1, 1, l/d);
            aux.setElement(2, 0, -l*n/d);
            aux.setElement(2, 1, -m*n/d);
            aux.setElement(2, 2, d);
        }
        
            //Setting the value of the matrix for an element whose positive local x axis is parallel to the global positive z axis
            else if(n==1) {
                //Setting the value of the aux matrix
                aux.setElement(0, 2, 1);
                aux.setElement(1, 1, 1);
                aux.setElement(2, 0, -1);
            }
            
            //Setting the value of the matrix for an element whose positive local x axis opposites the global positive z axis
            else {
                //Setting the value of the aux matrix
                aux.setElement(0, 2, -1);
                aux.setElement(1, 1, 1);
                aux.setElement(2, 0, 1);
                
            }

            //Inserting the aux matrix at the postions (0,0) til (dl.getNumCol()*this.getNdf()-3,dl.getNumCol()*this.getNdf()-3) of the matrix
            for (int i = 0; i < ((dl.getNumCol()/3)*6)/3; i++) {
                aux.copySubMatrix(0, 0, 3, 3, 3*i, 3*i, transf);
            }
        return (transf);
    }
	
	/* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getJ2(br.ufmg.dees.insane.util.IVector)
     */
    public double getJ2(IVector s) {
        // TODO Auto-generated method stub
        return 0;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getdJ2dSIG(br.ufmg.dees.insane.util.IVector)
     */
    public IVector getdJ2dSIG(IVector s) {
        // TODO Auto-generated method stub
        return null;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getJ3(br.ufmg.dees.insane.util.IVector)
     */
    public double getJ3(IVector s) {
        // TODO Auto-generated method stub
        return 0;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getdJ3dSIG(br.ufmg.dees.insane.util.IVector)
     */
    public IVector getdJ3dSIG(IVector s) {
        // TODO Auto-generated method stub
        return null;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getI1(br.ufmg.dees.insane.util.IVector)
     */
    public double getI1(IVector s) {
        // TODO Auto-generated method stub
        return 0;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getdI1dSIG(br.ufmg.dees.insane.util.IVector)
     */
    public IVector getdI1dSIG(IVector s) {
        // TODO Auto-generated method stub
        return null;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getI2(br.ufmg.dees.insane.util.IVector)
     */
    public double getI2(IVector s) {
        // TODO Auto-generated method stub
        return 0;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getdI2dSIG(br.ufmg.dees.insane.util.IVector)
     */
    public IVector getdI2dSIG(IVector s) {
        // TODO Auto-generated method stub
        return null;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getI3(br.ufmg.dees.insane.util.IVector)
     */
    public double getI3(IVector s) {
        // TODO Auto-generated method stub
        return 0;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getdI3dSIG(br.ufmg.dees.insane.util.IVector)
     */
    public IVector getdI3dSIG(IVector s) {
        // TODO Auto-generated method stub
        return null;
    }

	/* (non-Javadoc)
	 * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#modifyInternalVariableOperator(br.ufmg.dees.insane.util.IMatrix, br.ufmg.dees.insane.util.IMatrix)
	 */
	public IMatrix modifyInternalVariableOperator(IMatrix e, IMatrix p) {
		// TODO Auto-generated method stub
		return e;
	}

	@Override
	public IMatrix getLocalStiffnessMatrix(double[] properties) {
		IMatrix mat = new IMatrix(12,12);
		mat.setZero();
		
		double l = properties [0];
		double e = properties[1];
		double g = properties[2];
		double ix = properties[4];
		double iy = properties[5];
		double iz = properties[6];
		double a = properties[7];
		double fy = properties[9];
		
		//Setting the value of ae = (A*E)
		double ae = a * e;
		//Setting the value of gj = (G*Ix)
		double gj = g * ix;
		//Setting the value of eiz = (E*Iz)
		double eiz = e * iz;
		//Setting the value of eiy = (E*Iy)
		double eiy = e * iy;
		//Setting the value of gy = 6*fy*eiz/(g*a*l)
		double gy = 6*fy*eiz/(g*a*l);
		//Setting the value of gy = 6*fy*eiy/(g*a*l)
		double gz = 6*fy*eiy/(g*a*l);
		//Setting the value of l3 = l^3 and l2 = l^2
		double l3 = Math.pow(l, 3);
		double l2 = Math.pow(l, 2);
		//Setting the value of factorY = 1/(1 + 2*gy)
		double factorY= 1 + 2*gy;
		//Setting the value of factorY = 1/(1 + 2*gy)
		double factorZ= 1 + 2*gz;
		
		//Setting the value of the upper triangular part of the matrix
		mat.setElement(0, 0, ae/l);
		mat.setElement(0, 6, -ae / l);
		
		mat.setElement(1, 1, 12 * eiz / l3 * factorY);
		mat.setElement(1, 5, 6 * eiz / l2 * factorY);
		mat.setElement(1, 7, -12 * eiz / l3 * factorY);
		mat.setElement(1, 11, 6 * eiz / l2 * factorY);
		
		mat.setElement(2, 2, 12 * eiy /l3 * factorZ);
		mat.setElement(2, 4, -6 * eiy / l2 * factorZ);
		mat.setElement(2, 8, -12 * eiy /l3 * factorZ);
		mat.setElement(2, 10, -6 * eiy / l2 * factorZ);
		
		mat.setElement(3, 3, gj / l);
		mat.setElement(3, 9, -gj / l);
		
		mat.setElement(4, 4, 4 * eiy / l * factorZ * (1+gy/2));
		mat.setElement(4, 8, 6 * eiy / l2 * factorZ);
		mat.setElement(4, 10, 2 * eiy /l * factorZ * (1-gy));
		
		mat.setElement(5, 5, 4 * eiz / l * factorY * (1+gz/2));
		mat.setElement(5, 7, -6 * eiz / l2* factorY);
		mat.setElement(5, 11, 2 * eiz / l * factorY * (1-gz));
		
		mat.setElement(6, 6, ae / l);
		
		mat.setElement(7, 7, 12 * eiz / l3 * factorY);
		mat.setElement(7, 11, -6 * eiz / l2 * factorY);
		
		mat.setElement(8, 8, 12 * eiy / l3 * factorZ);
		mat.setElement(8, 10, 6 * eiy / l2 * factorZ);
		
		mat.setElement(9, 9, gj / l);
		
		mat.setElement(10, 10, 4 * eiy /l * factorZ * (1+gy/2));
		
		mat.setElement(11, 11, 4 * e * iz / l * factorY * (1+gz/2));
		
		//Setting the value of the lower triangular part od the matrix (symmetry)
		for (int i=0; i<12; i++)
			for (int j=0; j<i; j++)
				mat.setElement(i, j, mat.getElement(j, i));
		return (mat);
	}

	@Override
	public IMatrix nodalRotationMatrix(double angle1, double angle2) {
		//A SpaceFrame element do not accept inclined supports (in this program)
		IMatrix mat = new IMatrix(12, 12);
		return (mat);
	}

	public ArrayList getDOFLabels() {
		// TODO Auto-generated method stub
		return null;
	}

	public IMatrix getPMatrix() {
		// TODO Auto-generated method stub
		return null;
	}
	
}